package com.ruoyi.service;

//import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.dto.SysDTO;
import com.ruoyi.entity.Sys;
import com.ruoyi.mapper.SysMapper;
import com.ruoyi.param.SysParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DataSource(value = DataSourceType.SLAVE)
public class SysService {

    @Autowired
    private SysMapper sysMapper;


    public Page<SysDTO> selectList(SysParam sysParam){
        Page<Sys> page1 =new Page<>(sysParam.getPage(),sysParam.getSize());
        Page<SysDTO> sysDTOS = sysMapper.selectList(page1,sysParam.getPlCode(),sysParam.getOperStatus(),sysParam.getStartTime(),sysParam.getEndTime(),sysParam.getPlateNumber(),sysParam.getPhone(),sysParam.getSpaceCode());
//        List<SysDTO> sysDTOS = sysMapper.listAll(page1);
        return sysDTOS;
    }
}
